Electronic devices having a touch screen nowadays have a lock screen function that prevents the electronic device from accidental touches that may make the electronic device perform undesired applications or operation. The lock screen function supported by these electronic devices in the market requires users to perform a certain action: such as entering a preset password, dragging a lock icon or an app icon shown on the touch screen, or performing a preset gesture using the touch screen. However, these unlock mechanisms are unchangeable and have no variety such that users may feel bored with the unlock mechanisms to unlock the electronic devices.